-
Notifications
You must be signed in to change notification settings - Fork 684
Improve lexer_expect_object_literal_id option handling #2436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve lexer_expect_object_literal_id option handling #2436
Conversation
@@ -379,7 +379,7 @@ parser_parse_class_literal (parser_context_t *context_p, /**< context */ | |||
lexer_skip_empty_statements (context_p); | |||
} | |||
|
|||
lexer_expect_object_literal_id (context_p, false); | |||
lexer_expect_object_literal_id (context_p, LEXER_OBJ_IDENT_CLASS_METHOD | LEXER_OBJ_IDENT_NO_OPTS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LEXER_OBJ_IDENT_NO_OPTS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, it is unnecessary.
89e5115
to
2445998
Compare
{ | ||
lexer_skip_spaces (context_p); | ||
|
||
#ifndef CONFIG_DISABLE_ES2015_CLASS | ||
int is_class_method = ((context_p->status_flags & PARSER_IS_CLASS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this flag still used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no longer needed so it had been removed here.
@@ -68,7 +68,6 @@ typedef enum | |||
PARSER_ARROW_PARSE_ARGS = (1u << 19), /**< parse the argument list of an arrow function */ | |||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */ | |||
#ifndef CONFIG_DISABLE_ES2015_CLASS | |||
PARSER_IS_CLASS = (1u << 20), /**< statements parsed inside class body */ | |||
PARSER_CLASS_CONSTRUCTOR = (1u << 21), /**< a class constructor is parsed */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change 21 to 20 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've forgotten it.
This patch allows to add further options flags to `lexer_expect_object_literal_id` to handle unique behaviors more easily also substitutes `PARSER_IS_CLASS` flag hence it is removed. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
2445998
to
4d4bec7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Refs: jerryscript-project/jerryscript#2431 Refs: jerryscript-project/jerryscript#2496 Refs: jerryscript-project/jerryscript#2485 Refs: jerryscript-project/jerryscript#2530 Refs: jerryscript-project/jerryscript#2547 Refs: jerryscript-project/jerryscript#2436 Refs: jerryscript-project/jerryscript#2467 Refs: jerryscript-project/jerryscript#2481 Refs: jerryscript-project/jerryscript#2408 Refs: jerryscript-project/jerryscript#2430 Refs: jerryscript-project/jerryscript#2439 Refs: jerryscript-project/jerryscript#2588
This patch allows to add further options flags to
lexer_expect_object_literal_id
to handle unique behaviors more easilyalso substitutes
PARSER_IS_CLASS
flag hence it is removed.JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]